home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / OS⁄Toolbox / QuickDraw / MonitorExtensions / Extend.p next >
Encoding:
Text File  |  1990-09-14  |  3.3 KB  |  99 lines  |  [TEXT/MPS ]

  1. {------------------------------------------------------------------------------
  2. #
  3. #    Macintosh Developer Technical Support
  4. #
  5. #    Copyright © 1989 Apple Computer, Inc.
  6. #    All rights reserved.
  7. #
  8. #    Versions:    0.0                    4/89
  9. #
  10. #    
  11. ------------------------------------------------------------------------------}
  12.  
  13.  
  14. UNIT MonExtendCDEV;
  15.  
  16. INTERFACE
  17.  
  18. USES
  19.  
  20.     MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf;
  21.  
  22. CONST
  23.  
  24.     textItm        = 1;            {first editTExt item in cdev}
  25.  
  26.     SlotCount    =  6;            { a reasonable value, isn't it?        }
  27.     INITMSG    = 1;                {sent before the dialog is actually displayed}
  28.     OKMSG    = 2;                {indicates we are quitting and actions should stick}
  29.     CANCELMSG    = 3;            {indicates we are quitting and actions should not stick}
  30.     HITMSG    = 4;                {sent when an extensions control is hit}
  31.     NULMSG    = 5;                {a periodic event}
  32.     UPDATEMSG    = 6;            {this SHOULD be handled by user code and built-in controls}
  33.     ACTIVATEMSG    = 7;            {currently not used as we are a modalDialog}
  34.     DEACTIVATEMSG    = 8;        {currently not used as we are a modalDialog}
  35.     KEYEVTMSG    = 9;            {sent for keyboard events.  EditText should handle automatically}
  36.     SUPERMSG    = 10;            {sent if should show Super User controls}
  37.     NORMALMSG    = 11;            {sent if should not show Super User controls}
  38.     STARTUPMSG    = 12;            {sent as soon as the code is loaded, before any resources are found}
  39.  
  40. TYPE
  41. ScrnRecord = RECORD        {‘scrn’ info for each screen}
  42.     srDrvrHW:    INTEGER;    {spDrvrHW from slot decl mgr’s device type}
  43.     srSlot:    INTEGER;    {Slot number for the screen’s video card}
  44.     srDCtlDevBase:    LONGINT;    {Base address of card’s memory}
  45.     srMode:    INTEGER;    {sRsrcID for desired mode}
  46.     srFlagMask:    INTEGER;    {$77FE}
  47.     srFlags:    INTEGER;    {active, main screen, B/W or color}
  48.     srColorTable:    INTEGER;    {Resource ID of desired ‘clut’}
  49.     srGammaTable:    INTEGER;    {Resource ID of desired ‘gama’}
  50.     srRect:    Rect;    {Device’s rectangle, global coordinates}
  51.     srCtlCount:    INTEGER;    {Number of control calls}
  52. END;
  53. ScrnRecordPtr = ^ScrnRecord;
  54. ScrnRecordHandle = ^ScrnRecordPtr;
  55.  
  56. ScrnRsrc = RECORD        {Complete ‘scrn’ resource}
  57.     count:    INTEGER;    {Number of screens configured here}
  58.     scrnRecs:    ARRAY[1..SlotCount] OF ScrnRecord;    {Config for @ one}
  59. END;
  60. ScrnRsrcPtr = ^ScrnRsrc;
  61. ScrnRsrcHandle = ^ScrnRsrcPtr;
  62.  
  63. CodePtr = ^LONGINT;        {Dummy pointer type}
  64.  
  65. FUNCTION MonExtend (    message,                    {the action to handle}
  66.                         Item,                        {the DITL item hit or 0}
  67.                         numItems:    INTEGER;        {the number of Monitors last item}
  68.                         monitorValue:    LONGINT;    {value returned last time. Defaults to 0}
  69.                         mDialog:    DialogPtr;        {the dialog pointer}
  70.                         theEvent:    EventRecord;    {event that caused the message to happen}
  71.                         ScreenNum:    INTEGER;        {the number of the screen to affect}
  72.                         VAR Screens:    ScrnRsrcHandle;    {the screen resource to change if desired}
  73.                         VAR ScrnChanged:    BOOLEAN    {TRUE if Monitors should clean up Screens}
  74.                         ):LONGINT;                    {value to pass back as monitorValue or an error code}
  75.  
  76.  
  77. IMPLEMENTATION
  78.  
  79. FUNCTION MonExtend (    message,Item,numItems:    INTEGER;
  80.                         monitorValue:    LONGINT;
  81.                         mDialog:    DialogPtr;
  82.                         theEvent:    EventRecord;
  83.                         ScreenNum:    INTEGER;
  84.                         VAR Screens:    ScrnRsrcHandle;
  85.                         VAR ScrnChanged: BOOLEAN
  86.                     ):LONGINT;    
  87.  
  88. VAR
  89.     tempChar    : CHAR;
  90. BEGIN
  91.     CASE message OF
  92.     initMSG:                                            {initialize cdev}
  93.         BEGIN
  94.           {Let do nothing at all}
  95.         END;
  96.     END;
  97.     MonExtend := monitorValue;                            { return old value    }
  98. END; {MonExtend}
  99. END.